﻿using System;
using System.Text;
using System.Data;
using System.Drawing;
using System.Windows.Forms;

namespace ElectronicWMSA.Warehouse
{
    public partial class Afrm : Form
    {
        public Afrm()
        {
            InitializeComponent();
        }

        private void btnUserSearch_Click(object sender, EventArgs e)
        {
            try
            {
                string product = txt_Machine.Text.Trim();
                string SN = txt_SN.Text.Trim();
                if (product == "")
                {
                    MessageBox.Show("不能为空");
                    return;
                }
                if (SN == "")
                {
                    MessageBox.Show("不能为空");
                    return;
                }
                WMSADBUtility.DBHelper.ExecuteSql("UPDATE [DB_WMSFIRST].[dbo].[T_Stock]        SET  BK11='1'  WHERE Product_Model = '" + product + "' and  Serial_Number ='" + SN + "'");
                WMSADBUtility.DBHelper.ExecuteSql("UPDATE [DB_WMSFIRST].[dbo].[T_StockPrepare] SET  BK11='1'  WHERE Product_Model = '" + product + "' and  Serial_Number ='" + SN + "'");
                MessageBox.Show("操作成功！");
            }
            catch (Exception)
            {
                MessageBox.Show("操作失败，请检查【机型】和【序列号】是否正确！");
            }
        }
    }
}
